yjx.directive('updateMsg',['$compile','$timeout',function($compile,$timeout){
    return{
        restrict: 'EAC',
        scope: false,
        link: function ($scope, $element, attr) {
            $scope._updated = false;
            //console.log($scope._updated)
            $scope.$watch(attr.updateMsg, function (newVal) {
                $timeout(function () {
                    $scope.addhtml(newVal);
                })
                var html = ''
                $scope.addhtml = function (updated) {
                    /*html拼接前面一定不能留空格*/
                    html += '<li class="msgItem dfc jsfs  borderB" ng-repeat="item in msgList">' +
                        '<div><div class=" dfr jsfs aic "><div class="msgIcon"></div><div class="dfc w100 "><span class="c50  f12 ">{{item.content}}</span></div></div><div class="dfr w100 aic  msgAct" ng-show="item.type == 2 && item.dealStatus == 0"><span class="btn_msgAct cborange"ng-click="msgAct(item.messageId,item.contentId,0);item.dealStatus=1">拒绝</span><span class="btn_msgAct cbgreen" ng-click="msgAct(item.messageId,item.contentId,1);item.dealStatus=1">同意</span></div>' +
                        '<div class="dfr jsfe"><span class="c7f f10">{{item.createTime | date: \'yyyy-MM-dd\'}}</span></div></div></li>';
                    var $html = $compile(html)($scope);
                    $element.html($html);
                }
            })
        }
    }
}])